package com.x52im.rainbowchat.http.logic.pay.alipay;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.eva.framework.dbpool.DBShell;

import java.util.Map;

public class MQuery {
    DBShell db = new DBShell();

    /**
     * 查询充值结果
     *
     * @param newDataJSON
     * @return
     */
    public String queryDepositResult(String newDataJSON) throws Exception {
        JSONObject jsonObject = JSON.parseObject(newDataJSON);
        String outTradeNo = jsonObject.getString("outTradeNo");
        String sql = "SELECT a.trade_status, a.total_amount FROM alipay_deposit_notify a WHERE a.out_trade_no='" + outTradeNo + "'";
        Map<String, Object> result = db.queryDataMap(sql);
        return JSON.toJSONString(result);
    }
}
